import DEVICECHECK from 'service/apis/deviceCheck'
import Request from 'service/request'


// 查询： 计划状态选项:GET
export async function planOption() {
    return Request({ 
        url: DEVICECHECK.CHECK_PLAN_OPTIONS + '?ver=' + (new Date()).getTime() 
    })
}

// 添加点检计划: POST
export async function addCheck(params) {
    return Request({
        url: DEVICECHECK.ADD_CHECK,
        data: params,
        method: 'POST',
    })
}

// 删除点检计划: DELETE
export async function deleteCheck({ id }) {
    return Request({
        url: DEVICECHECK.DELETE_CHECK + '/' + id,
        method: 'DELETE'
    })
}

// 计划启用停用: POST
export async function getCheckStatus(params) {
    return Request({
        url: DEVICECHECK.CHECK_ENABLE_STATUS,
        data: params,
        method: 'POST'
    })
}

// 查看点检详情: GET
export async function getCheck({ id }) {
    return Request({
        url: DEVICECHECK.GET_CHECK + '/' + id + '?ver=' + (new Date()).getTime(),
    })
}

// 搜索点检计划: POST
export async function searchCheck(params) {
    return Request({
        url: DEVICECHECK.SEARCH_CHECK_QUERY,
        data: params,
        method: 'POST'
    })
}

// 获取点检项目（任务）预置: GET
export async function checkTaskConf(params) {
    return Request({
        url: DEVICECHECK.CHECK_TASK_CONF,
        data: params,
    })
}

// 查询所有的预制点检项目: GET
export async function checkTaskConfAll() {
    return Request({ 
        url: DEVICECHECK.CHECK_TASK_CONF_ALL 
    })
}

// 修改点检计划: PUT
export async function checkUpdate(params) {
    return Request({
        url: DEVICECHECK.CHECK_UPDATE,
        data: params,
        method: 'PUT'
    })
}

// 修改点检计划: PUT
export async function getByCheckTaskId(params) {
    return Request({
        url: DEVICECHECK.CHECK_TASK_CASE,
        data: params,
        method: 'POST'
    })
}

// 点检设备选项: POST
export async function checkFacilitys(params) {
    return Request({
        url: DEVICECHECK.CHECK_FACILITY,
        data: params,
        method: 'POST'
    })
}

// 获取设备详细信息: GET
export async function facilityDetail({ id }) {
    return Request({
        url: DEVICECHECK.CHECK_FACILITY_DETAIL + '/' + id,
    })
}

// 点检员选项: POST
export async function checkUser(params) {
    return Request({
        url: DEVICECHECK.CHECK_USER,
        data: params,
        method: 'POST'
    })
}

// 弹框列表
export async function geModelList(params) {
    return Request({
        url: DEVICECHECK.GET_BY_CHECKID,
        data: params,
        method: 'POST'
    })
}

// 获取流程信息
export async function getProccessMsg({ id }) {
    return Request({
        url: DEVICECHECK.PROCESS_GET + '/' + id + '?ver=' + (new Date()).getTime(),
    })
}


// 获取编辑详情
export async function getEditorInfo({ id }) {
    return Request({
        url: DEVICECHECK.PROCESS_EDTITOR_INFO + '/' + id + '?ver=' + (new Date()).getTime(),
    })
}